Fixing incorrect versioning on close records #4786
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes bug https://microsofthealth.visualstudio.com/Health/_workitems/edit/138656
If all clocks (i.e. clocks of processing clients and the database clock) are synchronized, explicit input lastUpdated on the ingested resource should always be either in the past or current relative to the database clock. This rule is important in order to guarantee that records without explicit lastUpdated (when they are processed in parallel with records with explicit lastUpdated) are loaded with correct versions and history flags in the database. To facilitate this logic, input parser rejects records with explicit lastUpdated pointing too far in the future (>10 seconds). 10 seconds "future tolerance" should be more than enough for current computer systems. "Future tolerance" interval cannot be arbitrary large to minimize number of retries required to land input records without explicit lastUpdated after latest records in the database.